import ajax from '@/utils/request'

export function addressDefaultIdFn() {
  return ajax({
    url: '/address/defaultId',

  })
}

export function addressListFn() {
  return ajax({
    url: '/address/list',
  })
}

export function setDefaultFn(addressId) {
  return ajax({
    url: '/address/setDefault',
    method: 'post',
    data: {
      addressId
    }

  })
}


export function addressremoveFn(addressId) {
  return ajax({
    url: '/address/remove',
    method: 'post',
    data: {
      addressId
    }
  })
}

export function addressEditFn(form) {
  return ajax({
    url: '/address/edit',
    method: 'post',
    data: form,
  })
}


export function regionTreeFn() {
  return ajax({
    url: '/region/tree',

  })
}

export function addressAddFn(data) {
  return ajax({
    url: '/address/add',
    method: 'post',
    data
  })
}